package com.im.common.web;

/**
 * 描述：请求返回数据
 * 
 * @author XiaHui
 * @date 2015年12月24日 下午9:06:33
 * @version 0.0.1
 */
public class ResponseMessage {

	private String type;
	private String message;

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public static final String type_success = "success";
	public static final String type_prompt = "prompt";
	public static final String type_warn = "warn";
	public static final String type_error = "error";

	public static ResponseMessage createSuccessMessage(String message) {
		ResponseMessage m = new ResponseMessage();
		m.setType(type_success);
		m.setMessage(message);
		return m;
	}

	public static ResponseMessage createPromptMessage(String message) {
		ResponseMessage m = new ResponseMessage();
		m.setType(type_prompt);
		m.setMessage(message);
		return m;
	}

	public static ResponseMessage createWarnMessage(String message) {
		ResponseMessage m = new ResponseMessage();
		m.setType(type_warn);
		m.setMessage(message);
		return m;
	}

	public static ResponseMessage createErrorMessage(String message) {
		ResponseMessage m = new ResponseMessage();
		m.setType(type_error);
		m.setMessage(message);
		return m;
	}
}
